<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>清除浮动</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" user-scalable="no">
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .outer {
            width: 100px;
            height: 100px;
            background-color: blue;
            margin: 0 auto;
            overflow: hidden;
        }

        .inner {
            width: 50px;
            height: 50px;
            margin-top: 30px;
            background-color: green;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="inner">

    </div>
</div>
</body>
</html>
